############### Basic Examples ############### .. role:: raw-html(raw) :format: html :raw-html:`

` AMB21/AMB22 Supported ARDUINO built-in example table :raw-html:`

` :raw-html:`

` There are many built-in examples in Arduino. In the table below, we list all examples that are compatible with Ameba. :raw-html:`

` | Please refer to the following link to set up Ameba for Arduino IDE: | ``_ | Please refer to the following link for Arduino built-in example details: | ``_ +----------------+---------------------+------------------------+--------------------+ | **Category** | **Name** | **Comment** | **Remarks** | +================+=====================+========================+====================+ | 01. | AnalogReadSerial | Connect potentiometer | ADC pin options | | Basics | | to 3.3V. | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | | BareMinimum | | | +----------------+---------------------+------------------------+--------------------+ | | Blink | Pin LED_BUILTIN sets | | | | | to pin D8. | | +----------------+---------------------+------------------------+--------------------+ | | DigitalReadSerial | | | +----------------+---------------------+------------------------+--------------------+ | | Fade | | | +----------------+---------------------+------------------------+--------------------+ | | ReadAnalogVoltage | | ADC pin options | | | | | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | 02. | BlinkWithoutDelay | Pin LED_BUILTIN sets | | | Digital | | to pin D8. | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | Button | Connect LED to pin | | | | | D13. | | +----------------+---------------------+------------------------+--------------------+ | | Debounce | Connect LED to pin | | | | | D13. | | +----------------+---------------------+------------------------+--------------------+ | | Digital | Connect LED to pin | | | | InputPullup | D13. | | +----------------+---------------------+------------------------+--------------------+ | | StateChange | Connect LED to pin | | | | Detection | D13. | | +----------------+---------------------+------------------------+--------------------+ | | toneKeyboard | | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | toneMelody | | | +----------------+---------------------+------------------------+--------------------+ | | toneMultiple | | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | tonePitch | | | | | Follower | | | +----------------+---------------------+------------------------+--------------------+ | 03. | Analog | | ADC pin options | | Analog | InOutSerial | | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | | AnalogInput | Connect LED to pin | ADC pin options | | | | D13. | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | | Analog | | | | | Write Mega | | | +----------------+---------------------+------------------------+--------------------+ | | Calibration | Connect another LED to | ADC pin options | | | | pin D13. | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | | Fading | | | +----------------+---------------------+------------------------+--------------------+ | | Smoothing | | ADC pin options | | | | | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | 04. | ASCIITable | | | | Communication | | | | | | | | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | Dimmer | | | +----------------+---------------------+------------------------+--------------------+ | | Graph | Connect potentiometer | ADC pin options | | | | to 3.3V. | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | | Midi | Use Serial1 and pin | | | | | D26, or use Serial2 | | | | | and pin D17. | | +----------------+---------------------+------------------------+--------------------+ | | MultiSerial | | | +----------------+---------------------+------------------------+--------------------+ | | PhysicalPixel | | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | Read | | | | | ASCIIString | | | +----------------+---------------------+------------------------+--------------------+ | | SerialCallResponse | | ADC pin options | | | | | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | | SerialCallResponse | | ADC pin options | | | ASCII | | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | | SerialEvent | | | +----------------+---------------------+------------------------+--------------------+ | | Serial | | Serial options, | | | Passthrough | | Serial1 or | | | | | Serial2. | +----------------+---------------------+------------------------+--------------------+ | | Virtual | | ADC pin options | | | ColorMixer | | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | 05. | Arrays | Use pins D1, D2, D3, | | | Control | | D4, D5, D6. | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | ForLoop | Use pins D1, D2, D3, | | | | Iteration | D4, D5, D6. | | +----------------+---------------------+------------------------+--------------------+ | | IfStatement | | ADC pin options | | | Conditional | | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | | switchCase | | ADC pin options | | | | | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | | switchCase2 | Use pins D1, D2, D3, | | | | | D4, D5, D6. | | +----------------+---------------------+------------------------+--------------------+ | | While | Connect another LED to | ADC pin options | | | Statement | pin D13. | A0, A1, A2, A3, | | | Conditional | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | 06. | barGraph | Use another pin to | ADC pin options | | Display | | replace pin D7. | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | | RowColumn | | ADC pin options | | | Scanning | | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | 07. | Character | | | | Strings | Analysis | | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | StringAddition | | | | | Operator | | | +----------------+---------------------+------------------------+--------------------+ | | StringAppend | | | | | Operator | | | +----------------+---------------------+------------------------+--------------------+ | | String | | | | | CaseChanges | | | +----------------+---------------------+------------------------+--------------------+ | | String | | | | | Characters | | | +----------------+---------------------+------------------------+--------------------+ | | StringComparision | | ADC pin options | | | Operators | | A0, A1, A2, A3, | | | | | A4, A5 and A6. ADC | | | | | pin reading | | | | | voltage range 0 to | | | | | 3.3V. | +----------------+---------------------+------------------------+--------------------+ | | StringIndexOf | | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | StringLength | | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | StringLengthTrim | | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | StringReplace | | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | StringStartsWith | | | | | EndsWith | | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | StringSubstring | | | | | | | | +----------------+---------------------+------------------------+--------------------+ | | StringToInt | | | +----------------+---------------------+------------------------+--------------------+